package com.example.demo3.entity.purplan;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.demo3.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;

/**
 * <p>
 * 采购计划表
 * </p>
 *
 * @author cjw
 * @since 2020-03-23
 */
@Data
@Accessors(chain = true)
@TableName("TEST_PUR_PLAN")
public class PurPlan implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	/**
	 * 采购计划表ID
	 */
	@TableId(value = "ID", type = IdType.UUID)
	private String id;
	
	/**
	 * 采购计划单号
	 */
	@TableField("PLAN_NO")
	private String planNo;
	
	/**
	 * 标题
	 */
	@TableField("TITLE")
	private String title;
	
	/**
	 * 详情
	 */
	@TableField("DES")
	private String des;
	
	/**
	 * 采购类型
	 */
	@TableField("PUR_TYPE")
	private String purType;
	
	/**
	 * 计划采购数量
	 */
	@TableField("PLAN_PUR_NUM")
	private Long planPurNum;
	
	/**
	 * 计划金额
	 */
	@TableField("PLAN_AMOUNT")
	private BigDecimal planAmount;
	
	/**
	 * 流程状态(0 进行中; 1 已结束;)
	 */
	@TableField("STATUS")
	private Integer status;
	
	/**
	 * 流程结束时间
	 */
	@TableField("FLOW_END_TIME")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date flowEndTime;
	
	/**
	 * 流程ID
	 */
	@TableField("FLOW_ID")
	private String flowId;
	
	/**
	 * 创建时间
	 */
	@TableField("CREATE_TIME")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	
	/**
	 * 创建者
	 */
	@TableField("CREATE_USER")
	private String createUser;
	
	/**
	 * 更新时间
	 */
	@TableField("UPDATE_TIME")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;
	
	/**
	 * 更新者
	 */
	@TableField("UPDATE_USER")
	private String updateUser;
	
	/**
	 * 是否删除(0 正常; 1 删除;)
	 */
	@TableField("IS_DEL")
	private Integer isDel;
	
	/**
	 * COLUMN_HEAD, COLUMN_WIDTH相关字段。
	 */
	public static final List<String> COLUMN_HEAD = new ArrayList<String>();
	public static final Map<Integer, Integer> COLUMN_WIDTH = new LinkedHashMap<Integer, Integer>(11);
	
	static {
		COLUMN_HEAD.add("计划单号");
		COLUMN_HEAD.add("标题");
		COLUMN_HEAD.add("采购类型");
		COLUMN_HEAD.add("采购计划数量");
		COLUMN_HEAD.add("计划金额");
		COLUMN_HEAD.add("创建日期");
		COLUMN_HEAD.add("创建人");
		COLUMN_HEAD.add("详情");
		COLUMN_HEAD.add("审批状态");
		COLUMN_HEAD.add("审批结束时间");
		
		COLUMN_WIDTH.put(0, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(1, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(2, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(3, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(4, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(5, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(6, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(7, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(8, (int) ((1000 * 25) / 3.57));
		COLUMN_WIDTH.put(9, (int) ((1000 * 25) / 3.57));
	}
	
}
